<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>日期和时间</title>
</head>

<body>
  <script>
    // 当前时间的时间戳
    let timestamp = Date.now()
    console.log(timestamp);

    // 当前时间的日期对象
    let now = new Date()
    console.log(now);
    console.log(now.toString());
    console.log(now.valueOf());
    // 转换为毫秒时间戳
    let ms = now.getDate()
    console.log(ms);
    // 转换为标准格式的字符串
    let iso = now.toISOString()
    console.log(iso);
  </script>
</body>

</html>